function MM_findObj(n, d) { //v4.01
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_showHideLayers() { //v6.0
var i,p,v,obj,args=MM_showHideLayers.arguments;
for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
if (obj.style) { obj=obj.style; v=(v=='show')?'inline':(v=='hide')?'none':v; }
obj.display=v; }
}

function switchSearch(target) {
targetArray = new Array ("cataleg","revista","metalib");
for (i=0; i<(targetArray.length); i++) {
MM_showHideLayers((targetArray[i]+"_form"),"","hide");
}
MM_showHideLayers((target+"_form"),"","show");
}

function onSubmitCataleg() {
if (cataleg_form.searcharg.value == "") {
return;
}
var newWind = window.open(
"http://uoc.cbuc.cat/search*" + idiomaMillennium(cataleg_form.lang.value) +
"/?searchtype=" + cataleg_form.searchtype.value +
"&searcharg=" + cataleg_form.searcharg.value +
"&searchscope=" + cataleg_form.searchscope.value
);
newWind.opener = null;
}

function onSubmitRevista() {
if (revista_form.param_pattern_value.value == "") {
return;
}
var newWind = window.open(
"http://biblioteca.uoc.edu/cgi-bin/pass/sfx.pl" +
"?param_lang_save=cat" +
"&param_perform_save=searchTitle" +
"&param_chinese_checkbox_save=0" +
"&param_services2filter_save=getFullTxt" +
"&param_current_view_save=table" +
"&param_jumpToPage_save=1" +
"&param_type_save=textSearch" +
"&param_textSearchType_value=contains" +
"&param_type_value=textSearch" +
"&param_pattern_value=" + revista_form.param_pattern_value.value
);
newWind.opener = null;
}

function onSubmitMetalib() {
if (metalib_form.find_request_1.value == "") {
return;
}
var newWind = window.open(
"http://biblioteca.uoc.edu/cgi-bin/pass/metalib.pl" +
"?func=quick-1-check1" +
"&mode=simple" +
"&find_request_2=" +
"&find_code_2=WRD" +
"&find_op_1=AND" +
"&find_code_3=WRD" +
"&find_request_3=" +
"&find_request_1=" + metalib_form.find_request_1.value +
"&group_number=" + metalib_form.group_number.value
);
newWind.opener = null;
}